/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - core/system/io/readers
// Copyright (c) 2014.  All Rights Reserved
//
// File:		AEBufferedStreamReader.h
// Author:		Gianluca Belardelli
// Date:		11/10/2013
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEBUFFEREDSTREAMREADER_H_
#define _AEBUFFEREDSTREAMREADER_H_

#define AE_BUFFEREDSTREAM_DEFAULT_READ_BUFSIZE (16*1024)

class AEBufferedStreamReader : public AESeekAndTellStreamReader
{
// Members
protected:
	AEStreamReader *m_lpReader;

// Methods
public:
	AE_DECLARE_CLASS_ALLOCATOR(TOBEDEFINED);

	AEBufferedStreamReader( AEStreamReader *lpReader, AEUINT32 uiBufferSize = AE_BUFFEREDSTREAM_DEFAULT_READ_BUFSIZE );
	~AEBufferedStreamReader( void );

	virtual int Read( void *lpBuf, AEINT32 nBytes );
	virtual int Skip( AEINT32 nBytes );
	virtual int Peek( void *lpBuf, AEINT32 nBytes );
	virtual AERESULT GetLastError( void ) const;
	virtual AERESULT Seek( AEINT32 nOffset, AESeekOptions soOpt );
	virtual AEINT32 Tell( void ) const;
};

#endif // _AEBUFFEREDSTREAMREADER_H_

